//#include <objbase.h>
#include "adodb.h"
#include <QApplication>
using namespace ADODB;
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    //CoInitialize(0);
    //_Connection
        _Connection myConnection;
        //myConnection.CreateInstance(__uuidof(ADODB::Connection));
        myConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.MDB;Persist Security Info=False;","","",0);
//        _Command pCommand;
////        pCommand.CreateInstance(__uuidof(Command));
//        pCommand.SetActiveConnection(myConnection.asVariant());
//        pCommand.SetCommandText("select * from muser where 1=2");
        _Recordset pRecordset;
//        pRecordset.CreateInstance(__uuidof(Recordset));
        pRecordset.SetCursorLocation(adUseClient);
        //pRecordset.SetActiveConnection(myConnection.asVariant());
        //QVariant *v=&myConnection.asVariant();
        pRecordset.SetCursorType(adOpenDynamic);
        pRecordset.SetLockType(adLockOptimistic);
        pRecordset.Open("select * from muser where 1=2");//,,adOpenDynamic,adLockOptimistic,adCmdUnknown);

        pRecordset.AddNew();
        pRecordset.Fields()->Item("mname")->SetValue("test");
        pRecordset.Update();
        pRecordset.Close();
        myConnection.Close();
     //   ::CoUninitialize();
        return a.exec();
}
